<?php session_start();?>
<!DOCTYPE html>
<html lang="en">

<?php
include '../config/config.inc';
include '../execute/auth.php';
?>
<?php 
$id=$_SESSION['USER_ID'];
?>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="assets/img/favicon.ico">
<link rel="stylesheet" href="../assets/css/style.css">
<title>Event Afghanistan</title>

<!-- Bootstrap core CSS -->
<link href="../assets/css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../assets/css/style.css" />

<!-- Custom styles for this template -->
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400'
	rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../assets/css/animate.css" />
<link rel="stylesheet" type="text/css" href="../assets/css/elements.css" />
<link rel="stylesheet" type="text/css" href="../assets/css/custom.css" />
<link
	href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"
	rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function(){
	$(".deleteEvent").on("click",function(){
		var conf=confirm("do you want to delete this file from your website ?");
		if(conf==true){
    var id=$(this).attr('name');
    window.location.replace("execute/deleteevent.php?id="+id);
    }else{
        return false;
        }
		});	
	$(".editEvent").on("click",function(){
	var id=$(this).attr('name');
	    window.location.replace("update.php?id="+id);
			
		});	
	});
</script>

</head>

<body>
<?php 
$conn = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$conn){
	echo mysql_error();
}
$db=mysql_select_db(DB_DATABASE);
if(!$db){
	mysql_error();
}
				$qry = mysql_query("SELECT * FROM `user` where id='$id'");
				if ($qry){
					
					$so=mysql_fetch_array($qry);
				}?>
	<!-- Navbar
	============= -->
	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target=".navbar-collapse">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="../index.php">Events </a>
			</div>
			<div class="collapse navbar-collapse">
				<ul class="nav navbar-nav">
					<li class="hidden-sm hidden-md"><a href="../index.php">Home</a>
					</li>
					<li class="hidden-sm hidden-md"><a href="../services.php">Services
					</a>
					</li>

					<li class="hidden-sm hidden-md"><a href="../calendar.php">Event
							Calendar </a>
					</li>
					<li class="hidden-sm hidden-md"><a href="../index.php">Voluntering
					</a>
					</li>
					<li class="hidden-sm hidden-md"><a href="../index.php">Resources </a>
					</li>
					<li class="hidden-sm hidden-md"><a href="../about-us.php">About</a>
					</li>
					<li class="hidden-sm hidden-md"><a href="../contact.php">Contact us</a>
					</li>
					<!-- Profile links for extra small screens -->
					<li class="visible-xs"><a href="../sign-in.php">Sign In</a>
					</li>
					<li class="visible-xs"><a href="#">Sign Out</a>
					</li>
				</ul>
				<!-- Search form for extra small screens -->
				<form class="navbar-form navbar-left visible-xs" role="search">
					<div class="form-group">
						<input type="text" class="form-control" placeholder="Search">
					</div>
					<button type="submit" class="hl-btn hl-btn-blue">Go!</button>
				</form>


				<ul class="nav navbar-nav navbar-right hidden-xs">
					<!-- Signed in. Profile Menu -->
					<li id="profile-menu" class="dropdown"><a href="#"
						class="dropdown-toggle" data-toggle="dropdown"><?php echo$so['fullname'] ;?> <b
							class="caret"></b> </a>
						<ul class="dropdown-menu">
							<li class="account">
								<div class="avatar"><img src="../assets/img/users/<?php echo $so['photo']; ?>" class="imgu"></div>
								<p>
								<br /><?php echo $so['email'];?>
								</p>
								<p>
									<a href="profile.php">Profile</a> | <a
										href="../execute/logout.php" id="sign-out">Sign out</a>
								</p>
								<div class="clearfix"></div>
							</li>
						</ul>
					</li>

				</ul>
			</div>
		</div>
	</div>

	<!-- Main body
================== -->
	<div class="wrapper">
		<div class="section-header">
			<div class="container">
				<div class="row">
					<div class="col-sm-12">
						<!-- Remove the .animated class if you don't want things to move -->
						<h1 class="animated slideInLeft">
							<span>My Event</span>
						</h1>
					</div>
				</div>
			</div>
		</div>
		<div class="container">
			<div class="row">
				<!-- Profile Menu -->
				<div class="col-sm-4 col-md-3">
					<div class="user-menu bottom-15">
						<ul>
							<li><a href="myevent.php"> <i class="sign fa fa-bell-o"
									style="background-color: #ff4900;"></i> My Events <i
									class="fa fa-chevron-right pull-right"></i> </a>
							</li>
							<li><a href="addevent.php"> <i
									class="sign fa fa-plus-square fa-3x"
									style="background-color: #FE2E64;"></i> Add New Events <i
									class="fa fa-chevron-right pull-right"></i> </a>
							</li>
							<li><a href="sponsorevent.php"> <i class="sign fa fa-anchor"
									style="background-color: #49ADF5;"></i> Sponsor Events <i
									class="fa fa-chevron-right pull-right"></i> </a>
							</li>
							<li><a href="exihabitevent.php"> <i class="sign fa fa-desktop"
									style="background-color: #00cc00;"></i> Exihabit Events <i
									class="fa fa-chevron-right pull-right"></i> </a>
							</li>
							<li><a href="joinevent.php"> <i class="sign fa fa-group"
									style="background-color: #009E8E;"></i> Join Events<i
									class="fa fa-chevron-right pull-right"></i> </a>
							</li>

							<li><a href="profile.php"> <i class="sign fa fa-user bg-amethyst"></i>
									My Profile <i class="fa fa-chevron-right pull-right"></i> </a>
							</li>

						</ul>

					</div>
				</div>
				<!-- Avatar & social links -->

				<!-- Welcome message
			================= -->
				<div class="col-md-8">
				<?php 
				$conn = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$conn){
	echo mysql_error();
}
$db=mysql_select_db(DB_DATABASE);
if(!$db){
	mysql_error();
}
				$qry = mysql_query("SELECT * FROM `event` ORDER BY startdate DESC limit 4");
				if (!$qry){
					echo mysql_error();
				}
				while($row = mysql_fetch_array($qry)){
				?>
					<div class="events-desc">
						<button class="col-md-2 col-md-offset-10 btn btn-info editEvent" name="<?php echo $row['id']; ?>"><i class="fa fa-pencil-square-o fa-lg"></i> &nbsp;Edit</button>
						<br><br><button class="col-md-2 col-md-offset-10 btn btn-danger deleteEvent" name="<?php echo $row['id']; ?>" onclick="deleteItem()"><i class="fa fa-trash-o fa-lg">&nbsp;Delete</i></button>

						<br> <img src="../assets/img/eventphoto/<?php echo $row['photo']?>" class="img-about img-responsive img">
						<h2><?php echo $row['title']; ?></h2>
						
						<p>
							<?php echo $row['description']?>
							<br> <br> <Strong>	EventDate :  <?php echo $row['startdate']."   To  ". $row['enddate'];?></Strong><br> <strong>Venue:
									<?php echo $row['venue']?></strong><br> <Strong>Agenda: <a href="../assets/uploadfile/<?php echo$row['agenda']?>" target="_blank">Download</a> </Strong><br> 
									<strong>Speaker:<?php echo $row['speaker']?>
								</strong><br> <strong>partner:<?php echo $row['partner']?></strong><br> <strong>Sponsor:<?php echo $row['sponsor']?>
								</strong><br> <strong>Orgnizer:<?php echo $row['organizer']?></strong><br><br>
							<button type="button" class="btn btn-info">join</button>
							<button type="button" class="btn btn-info">Sponsor</button>
							<button type="button" class="btn btn-info">Exihbit</button>

						</p>
						<br>
					</div>
					
					<?php } ?>

				</div>
			</div>

		</div>
	</div>

	<!-- Foooter
================== -->
	<footer>
		<div class="container">
			<div class="row">
				<!-- Contact Us 
		=================  -->
				<div class="col-sm-4">
					<div class="headline">
						<h3>Contact us</h3>
					</div>
					<div class="content">
						<p>
							TechNation <br> Dunya Plaza<br> Shahid Abdul Haq Square <br>
							Ground Floor <br>phone:0093 788 121 311<br /> Email: <a
								href="http://www.technation.af">info@technation.af</a>
						</p>
					</div>
				</div>
				<!-- Social icons 
		===================== -->
				<div class="col-sm-4">
					<div class="headline">
						<h3>Go Social</h3>
					</div>
					<div class="col-md-10">
						<div class="content social">
							<p>Stay in touch with us:</p>
							<ul>
								<li><a href="#"><i class="fa fa-twitter"></i> </a></li>
								<li><a href="#"><i class="fa fa-facebook"></i> </a></li>
								<li><a href="#"><i class="fa fa-pinterest"></i> </a></li>
								<li><a href="#"><i class="fa fa-youtube"></i> </a></li>
								<li><a href="#"><i class="fa fa-linkedin"></i> </a></li>
								<li><a href="#"><i class="fa fa-google-plus"></i> </a></li>
							</ul>
							<div class="clearfix"></div>
						</div>
						<h5>Message Alert</h5>
						<div class="input-group">
							<label class="sr-only" for="subscribe-email"> </label> <span
								class="input-group-addon"><img src="../assets/img/flag.jpg"> </span>
							<input type="text" class="form-control" id="phone"
								placeholder="your phone Number"> <span class="input-group-btn">
								<button type="submit" class="hl-btn hl-btn-default">send</button>
							</span>
						</div>
					</div>
				</div>
				<!-- Subscribe 
		=============== -->
				<div class="col-sm-4">
					<div class="headline">
						<h3>Subscribe</h3>
					</div>
					<div class="content">
						<p>
							Enter your e-mail below to subscribe to our free newsletter.<br />We
							promise not to bother you often!
						</p>
						<form class="form" role="form">
							<div class="row">
								<div class="col-sm-8">

									<input type="text" class="form-control" id="name"
										placeholder="Enter your Name">


									<div class="clearfix"></div>
									<br>

									<div class="input-group">
										<label class="sr-only" for="subscribe-email">Email address</label>
										<input type="email" class="form-control" id="subscribe-email"
											placeholder="Enter email"> <span class="input-group-btn">
											<button type="submit" class="hl-btn hl-btn-default">send</button>
										</span>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>


	</footer>
	<!-- Legal 
  ============= -->
	<div class="legal">
		<div class="container">
			<div class="row">
				<div class="col-sm-12">
					<p>
						&copy; The Events 2014. <a href="#">Privacy Policy</a> | <a
							href="#">Terms of Service</a>
					</p>
				</div>
			</div>
		</div>
	</div>

	<!-- Bootstrap core JavaScript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
	<script src="../assets/js/bootstrap.min.js"></script>
	<script src="../assets/js/custom.js"></script>
	<script src="../assets/js/scrolltopcontrol.js"></script>
	<!-- Scroll to top javascript -->
</body>
<?php
$we=mysql_query("SELECT * FROM `event`");
$row = mysql_fetch_array($qry);
					
				

?>
<!-- Modal -->
<div class="modal fade" id="edit" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">Edit your Event</h4>
			</div>
			<div class="modal-body">
				<div class="well">
					<form class="bs-example form-horizontal " action="" method="post"
						enctype="multipart/form-data">
						<fieldset>
							<legend>Required field</legend>


							<div class="form-group">
								<label for="input" class="col-lg-2 control-label"> Title</label>
								<div class="col-lg-9">
									<input type="text" class="form-control" id="title"
										value="<?php echo $row['title'] ;?>" name="title">
								</div>
							</div>
							<div class="form-group">
								<label for="input" class="col-lg-2 control-label">Date </label>
								<div class="col-lg-4">
									<input type="text" class="form-control" id="sdate" name="sdate"
										value="<?php echo $row['startdate'] ;?>" >
								</div>
								<div class="col-lg-4">
									<input type="text" class="form-control" id="edate" name="edate"
										value="<?php echo $row['enddate'] ;?>" >

								</div>
							</div>
							<div class="form-group">
								<label for="select" class="col-lg-2 control-label"> Category</label>
								<div class="col-lg-9">
									<select class="form-control" id="select" name="select" value="<?php echo $row['select'] ;?>" >
										<option value="1">1</option>
										<option value="2">2</option>
										<option value="3">3</option>
										<option value="4">4</option>
										<option value="5">5</option>
										<option value="6">6</option>
										<option value="7">7</option>
										<option value="8">8</option>
										<option value="9">9</option>
										<option value="10">10</option>
										<option value="11">11</option>
										<option value="12">12</option>
										<option value="13">13</option>
										<option value="14">14</option>
										<option value="15">15</option>
										<option value="16">16</option>
										<option value="17">17</option>
										<option value="18">18</option>
										<option value="19">19</option>
										<option value="20">20</option>
									</select> <br>

								</div>
							</div>

							<div class="form-group">
								<label for="input" class="col-lg-2 control-label"> Venue</label>
								<div class="col-lg-9">
									<input type="text" class="form-control" id="venue" name="venue"
										value="<?php echo $row['venue'] ;?>" >
								</div>
							</div>
							<div class="form-group">
								<label for="textArea" class="col-lg-2 control-label">Discription</label>
								<div class="col-lg-9">
									<textarea class="form-control" rows="3" id="textarea"
										name="textarea" value="<?php echo $row['description'] ;?>" ></textarea>

								</div>
							</div>

							<div class="form-group">
								<label class="col-lg-2 control-label">Photo about Event </label>
								<div class="col-lg-9">
									<input type="file" class="form-control" id="photo" name="photo" value="<?php echo $row['photo'] ;?>" >

								</div>
							</div>
						</fieldset>
						<fieldset>
							<legend>Important Info</legend>
							<div class="form-group">
								<label class="col-lg-2 control-label">Agenda </label>
								<div class="col-lg-9">
									<input type="file" class="form-control" id="file" name="file" value="<?php echo $row['agenda'] ;?>" >
								</div>
							</div>
							<div class="form-group">
								<label for="input" class="col-lg-2 control-label">Speaker</label>
								<div class="col-lg-9">
									<input type="text" class="form-control" id="speakar"
										name="speakar" value="<?php echo $row['speaker'] ;?>" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 control-label">Partner </label>
								<div class="col-lg-9">
									<input type="text" class="form-control" id="partnar"
										name="partnar" value="<?php echo $row['partner'] ;?>" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 control-label">Sponsor</label>
								<div class="col-lg-9">
									<input type="text" class="form-control" id="sponsor"
										name="sponsor" value="<?php echo $row['sponsor'] ;?>" >
								</div>
							</div>
							<div class="form-group">
								<label class="col-lg-2 control-label">Organizer </label>
								<div class="col-lg-9">
									<input type="text" class="form-control" id="organizer"
										name="organizer" value="<?php echo $row['organizer'] ;?>" >
								</div>
							</div>
						</fieldset>
						<fieldset>
							<legend>Optional</legend>
							<div class=" form-group">
								<label class="col-lg-7 control-label"> <input type="checkbox"
									style="width: 20px; height: 20px;" name="exhibition"
									value="yes"> 1. Do you want tarnsalition services ? </label>
							</div>
							<div class=" form-group">
								<label class="col-lg-7 control-label"> <input type="checkbox"
									style="width: 20px; height: 20px;" name="sponsorevent"
									value="yes"> 2. Do want do some compay Sponsor your event ? </label>
							</div>


							<div class=" form-group">
								<input type="submit" value="Update"
									class="btn btn-info col-md-5 col-md-offset-3 " name="submit">
							</div>

						</fieldset>
					</form>

				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
    $("#sdate").datepicker();
    $("#edate").datepicker();
  });
</script>
</html>

